package com.chenfan.mcn.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenfan.mcn.extension.log.FieldDesc;
import com.chenfan.mcn.constant.NumberFormatCst;
import com.chenfan.mcn.extension.log.FieldTypeEnum;
import com.chenfan.mcn.model.base.BaseTenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 红人月度结算单拆单表
 * </p>
 *
 * @author wulg
 * @since 2022-01-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("star_monthly_settlement_sub")
public class StarMonthlySettlementSub extends BaseTenantEntity {

    private static final long serialVersionUID = -8613269630698695112L;

    /**
     * 结算单ID
     */
    @TableField("settlement_id")
    private Long settlementId;

    /**
     * 子结算单号
     */
    @TableField("sub_settlement_code")
    private String subSettlementCode;

    /**
     * 我司签约主体id（取【公司管理】的数据）
     */
    @TableField("contracting_id")
    private Long contractingId;

    /**
     * 执行单可分成基数（元）（原：税前金额）
     */
    @FieldDesc(value ="执行单可分成基数（元）", format = NumberFormatCst.AMOUNT)
    @TableField("pretax_amount")
    private BigDecimal pretaxAmount;

    /**
     * 应扣税额（元）
     */
    @FieldDesc(value ="应扣税额（元）", format = NumberFormatCst.AMOUNT)
    @TableField("taxable_amount")
    private BigDecimal taxableAmount;

    /**
     * 扣文建税后分成基数
     */
    @FieldDesc(value ="扣文建税后分成基数（元）", format = NumberFormatCst.AMOUNT)
    @TableField("after_cultural_tax_divided")
    private BigDecimal afterCulturalTaxDivided;

    /**
     * 发票号
     */
    @FieldDesc(value ="发票号")
    @TableField("invoice_no")
    private String invoiceNo;

    /**
     * 开票日期
     */
    @FieldDesc(value ="开票日期", format = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @TableField("invoice_date")
    private Date invoiceDate;

    /**
     * 发票文件
     */
    @FieldDesc(value ="发票文件")
    @TableField("invoice_screenshot")
    private String invoiceScreenshot;

    /**
     * 线上结算打款日期
     */
    @FieldDesc(value ="线上结算打款日期", format = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @TableField("paid_date")
    private Date paidDate;

    /**
     * 线上结算-发票金额（元）
     */
    @FieldDesc(value ="线上结算-发票金额（元）", format = NumberFormatCst.AMOUNT)
    @TableField("online_invoice_amount")
    private BigDecimal onlineInvoiceAmount;

    /**
     * 线下结算-发票金额（元）
     */
    @FieldDesc(value ="线下结算-发票金额（元）", format = NumberFormatCst.AMOUNT)
    @TableField("offline_invoice_amount")
    private BigDecimal offlineInvoiceAmount;

    /**
     * 打款金额（元） （原：财务确认打款金额)
     */
    @FieldDesc(value ="打款金额（元）", format = NumberFormatCst.AMOUNT)
    @TableField("finance_paid_amount")
    private BigDecimal financePaidAmount;

    /**
     * 财务确认可分成金额（元）
     */
    @FieldDesc(value ="财务确认可分成金额（元）", format = NumberFormatCst.AMOUNT)
    @TableField("finance_confirmed_devided_amount")
    private BigDecimal financeConfirmedDevidedAmount;

    /**
     * 财务分成金额备注
     */
    @FieldDesc(value ="财务分成金额备注")
    @TableField("remark")
    private String remark;

    /**
     * 财务附件
     */
    @FieldDesc(value ="财务附件", fieldType = FieldTypeEnum.FILE)
    @TableField("finance_attachment")
    private String financeAttachment;

    /**
     * 是否核销回款：0否1是
     */
    @TableField("is_clear")
    private Integer isClear;

}
